﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VolInfoView.aspx.cs" Inherits="Volunteer.VolInfoView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Volunteer View</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="Panel1" runat="server" BackColor="#339966" BorderColor="#CCCCCC" 
            Height="73px" Width="1766px">
            <br /><br />
            <center><b>BATTERED WOMEN&#39;S NETWORK</b></center>
            <br />
        </asp:Panel>
        
    </div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
        DataSourceID="SqlDataSource1" ForeColor="#333333" 
        GridLines="None" Width="1763px" DataKeyNames="vid">
        <FooterStyle BackColor="White" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#CCFFCC" ForeColor="#333333" HorizontalAlign="Center" />
        <Columns>
            <asp:BoundField DataField="vid" HeaderText="vid" ReadOnly="True" 
                SortExpression="vid" />
            <asp:BoundField DataField="Status" HeaderText="Status" 
                SortExpression="Status" />
            <asp:TemplateField HeaderText="Title" SortExpression="Title">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlTitle" runat="server" DataSourceID="dsTitle" 
                        DataTextField="Title" DataValueField="Title" 
                        SelectedValue='<%# Bind("Title") %>' AutoPostBack="True" 
                        AppendDataBoundItems="True">
                        <asp:ListItem Value="">Choose Type...</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="FName" HeaderText="FName" SortExpression="FName" />
            <asp:BoundField DataField="LName" HeaderText="LName" SortExpression="LName" />
            <asp:TemplateField HeaderText="Gender" SortExpression="Gender">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlGender" runat="server" DataSourceID="dsGender" 
                        DataTextField="GenderText" DataValueField="Gender" 
                        SelectedValue='<%# Bind("Gender") %>' AutoPostBack="True" 
                        AppendDataBoundItems="True">
                        <asp:ListItem Value="">Choose gender...</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("Gender") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DOB" HeaderText="DOB" SortExpression="DOB" />
            <asp:TemplateField HeaderText="AgeRange" SortExpression="AgeRange">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlAgeRange" runat="server" DataSourceID="dsAgeRange" 
                        DataTextField="AgeRange" DataValueField="AgeRange" 
                        SelectedValue='<%# Bind("AgeRange") %>' AutoPostBack="True" 
                        AppendDataBoundItems="True">
                        <asp:ListItem Value="">Choose Age Range...</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("AgeRange") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="WorkPhone" HeaderText="WorkPhone" 
                SortExpression="WorkPhone" />
            <asp:BoundField DataField="CellPhone" HeaderText="CellPhone" 
                SortExpression="CellPhone" />
            <asp:BoundField DataField="HomePhone" HeaderText="HomePhone" 
                SortExpression="HomePhone" />
            <asp:BoundField DataField="Fax" HeaderText="Fax" SortExpression="Fax" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="Street" HeaderText="Street" 
                SortExpression="Street" />
            <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
            <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
            <asp:BoundField DataField="ZIP" HeaderText="ZIP" SortExpression="ZIP" />
            <asp:BoundField DataField="County" HeaderText="County" 
                SortExpression="County" />
            <asp:BoundField DataField="HireDate" HeaderText="HireDate" 
                SortExpression="HireDate" />
            <asp:BoundField DataField="TermDate" HeaderText="TermDate" 
                SortExpression="TermDate" ConvertEmptyStringToNull="False" 
                NullDisplayText="1/1/1900" />
            <asp:BoundField DataField="Ethnicity" HeaderText="Ethnicity" 
                SortExpression="Ethnicity" />
            <asp:BoundField DataField="Disability" HeaderText="Disability" 
                SortExpression="Disability" />
            <asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
            <asp:BoundField DataField="EnteredBy" HeaderText="EnteredBy" 
                SortExpression="EnteredBy" />
            <asp:TemplateField HeaderText="EducationLvl" SortExpression="EducationLvl">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddlEducationLvl" runat="server" DataSourceID="dsEduLevel" 
                        DataTextField="EduLvlName" DataValueField="EduLvlName" 
                        SelectedValue='<%# Bind("EducationLvl") %>' AutoPostBack="True" 
                        AppendDataBoundItems="True">
                        <asp:ListItem Value="">Choose Edu Level...</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Eval("EducationLvl") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <PagerStyle BackColor="White" ForeColor="#333333" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#CCFFCC" Font-Bold="True" ForeColor="Navy" HorizontalAlign="Center" />
        <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" />
        <AlternatingRowStyle BackColor="White" HorizontalAlign="Center" />
    </asp:GridView>
    <div>
        <center style="width: 1766px">
            <asp:LinkButton ID="lnkHome" runat="server" CausesValidation="False" 
                PostBackUrl="~/VolInfo.aspx">Home</asp:LinkButton>
            <br />
        </center>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VolunteerDBConnectionString %>" 
        SelectCommand="SELECT * FROM Volunteer_view ORDER BY LName" 
        DeleteCommand="up_Volunteer_Delete" DeleteCommandType="StoredProcedure" 
        UpdateCommand="up_Volunteer_Update" UpdateCommandType="StoredProcedure" 
        onupdating="SqlDataSource1_Updating">
        <DeleteParameters>
            <asp:Parameter Name="VID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="VID" Type="Int32" />
            <asp:Parameter Name="FName" Type="String" />
            <asp:Parameter Name="LName" Type="String" />
            <asp:Parameter Name="Street" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="State" Type="String" />
            <asp:Parameter Name="ZIP" Type="Int32" />
            <asp:Parameter Name="WorkPhone" Type="String" />
            <asp:Parameter Name="CellPhone" Type="String" />
            <asp:Parameter Name="HomePhone" Type="String" />
            <asp:Parameter Name="Fax" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="Status" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
            <asp:Parameter Name="DOB" Type="DateTime" />
            <asp:Parameter Name="HireDate" Type="DateTime" />
            <asp:Parameter Name="TermDate" Type="DateTime" />
            <asp:Parameter Name="EnteredBy" Type="String" />
            <asp:Parameter Name="Ethnicity" Type="String" />
            <asp:Parameter Name="AgeRange" Type="String" />
            <asp:Parameter Name="County" Type="String" />
            <asp:Parameter Name="Disability" Type="String" />
            <asp:Parameter Name="EducationLvl" Type="String" />
            <asp:Parameter Name="Gender" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsAgeRange" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VolunteerDBConnectionString %>" 
        SelectCommand="SELECT [AgeID], convert(varchar(2), agemin) + ' - ' + convert(varchar(2), agemax) as AgeRange
FROM [AgeRange]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="dsEduLevel" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VolunteerDBConnectionString %>" 
        SelectCommand="SELECT [EduID], [EduLvlName] FROM [EducationLevel]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="dsGender" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VolunteerDBConnectionString %>" 
        SelectCommand="SELECT [GenderID] as Gender, [GenderText] FROM [Gender]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsTitle" runat="server" 
        ConnectionString="<%$ ConnectionStrings:VolunteerDBConnectionString %>" 
        SelectCommand="SELECT [Title] FROM [Title]"></asp:SqlDataSource>
    </form>
</body>
</html>
